package com.ssh.dao.impl;

import java.util.List;
import java.util.Map;

import com.ssh.dao.LoginDao;
import com.ssh.util.DBConnections;

public class LoginDaoImpl implements LoginDao{

	@Override
	public int login(String name, String password) {
		String sql = "select count(1) as count from users where name = ? and password = ?";
		List<Map<String, Object>> list = DBConnections.query(sql, new Object[] {name,password});
		return Integer.parseInt(list.get(0).get("COUNT").toString());
	}

}
